export default (_self, h) => {
  return h(
    "el-radio-group",
    {
      props: {
        value: _self.obj.value,
      },
      attrs: {
        disabled: !_self.obj.status,
      },
      on: {
        change: (e) => {
          _self.obj.value = event.target.value;
        },
      },
    },
    _self.obj.detailList.map((v) => {
      return h(
        "el-radio",
        {
          props: {
            label: v.label,
          },
        },
        v.value
      );
    })
  );
};

export let radioConf = {
  status: true, // 启用状态，true启用；0停用
  elementWidth: "100%",
  elementType: "radio",// 对应数据库内类型
  elementName: "单选框",// 控件左侧label内容
  value: '', // 绑定的值
  detailList: [// 选项内数据
    {
      key: 0,
      label: "选项框1",
      value: "选项框1",
    },
    {
      key: 1,
      label: "选项框2",
      value: "选项框2",
    }
  ],
  key: 2,//配置的起始key
  icon: "el-icon-check",
  required: false,// 是否必填
  rules: []

};
